/*
 * LogPanel.java
 *
 * Created on 27. august 2008, 19:34
 */

package jturbofile.gui;

/**
 *
 * @author  Rolf
 */
public class LogPanel extends javax.swing.JPanel {

    private static LogPanel singleton;
    
    public static LogPanel singleton() {
        if( singleton == null ) {
            singleton = new LogPanel();
        }
        return singleton;
    }
    
    public void log(String msg) {
        System.out.print(msg);
        jLogArea.append(msg);
    }

    public void logln(String msg) {
        System.out.println(msg);
        jLogArea.append(msg+"\n");
    }
    
    /** Creates new form LogPanel */
    private LogPanel() {
        initComponents();
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jScrollPane1 = new javax.swing.JScrollPane();
        jLogArea = new javax.swing.JTextArea();

        jLogArea.setColumns(20);
        jLogArea.setEditable(false);
        jLogArea.setRows(5);
        jScrollPane1.setViewportView(jLogArea);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 400, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 300, Short.MAX_VALUE)
        );
    }// </editor-fold>//GEN-END:initComponents


    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JTextArea jLogArea;
    private javax.swing.JScrollPane jScrollPane1;
    // End of variables declaration//GEN-END:variables

}
